package com.juntuo.Enums;

public enum CertStatus {
    WAITING(0, "证书未查询"),
    OK(1, "证书正常"),
    MISSING(2, "证书查询不到"),
    NEED_CHANGE_LOGIC(-2, "DOM调整过了，需要重新写算法"),
    BAD_NET(-1, "网络连接不畅"),
    DELETED(-100,"已删除");
    private int code;

    private String desc;

    public int getCode() {
		return code;
	}

	public String getDesc() {
        return desc;
    }

    CertStatus(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }
    
    public static CertStatus getByStatus(int status){
        CertStatus result = null;
    	for (CertStatus e : CertStatus.values()) {
			if(e.getCode() == status){
				result = e;
				break;
			}
		}
    	return result;
    }
}
